﻿@using INNOVACALL.Framework.Common
@using InnovaApp.Layers.ResourcesLayer.Properties
@using InnovaApp.Portals.MVC4Portal.Controllers
@{
    bool translateMode = this.Request.QueryString["translate"] != null;

    Layout = "_LayoutSiteCommon.cshtml";
    string StyleBundleBase = string.Empty;
    InnovaApp.Layers.CommonLayer.Models.ViewModels.LayoutViewModels._LayoutViewModels_Base layoutModel =
        (InnovaApp.Layers.CommonLayer.Models.ViewModels.LayoutViewModels._LayoutViewModels_Base)Model;

    string adminModeCSSClass = (layoutModel._AdminMode ? "adminMode" : "");

    string cssResizableBlocks = string.Empty;

    //toTransfert
    int sp_Layout_MainContainerWidth = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_MainContainerWidth]);
    int sp_Layout_PageHeaderWidth = sp_Layout_MainContainerWidth;
    int sp_Layout_PageHeaderHeight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_HeaderHeight]);
    int sp_Layout_MainMenuWidth = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_MainMenuWidth]);
    int sp_Layout_MainMenuHeight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_MainMenuHeight]);
    int sp_Layout_PageContentWidth = sp_Layout_MainContainerWidth - sp_Layout_MainMenuWidth;
    int sp_Layout_PageContentHeight = sp_Layout_MainMenuHeight;
    int sp_Layout_PageFooterWidth = sp_Layout_PageHeaderWidth;
    int sp_Layout_PageFooterHeight = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_FooterHeight]);

    int sp_Layout_MainContainerHeight = sp_Layout_PageHeaderHeight + sp_Layout_MainMenuHeight + sp_Layout_PageFooterHeight;

    int sp_Layout_PageContent_Paddin_Top = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingTop]);
    int sp_Layout_PageContent_Paddin_Right = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingRight]);
    int sp_Layout_PageContent_Paddin_Bottom = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingBottom]);
    int sp_Layout_PageContent_Paddin_Left = int.Parse(PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingLeft]);

    cssResizableBlocks = string.Format(
@"
        #MyPrettyCMSMainContainer {{
            width:{0}px;
            height:{1}px;
        }}
        #MyPrettyCMSHeader {{
            width:{2}px;
            height:{3}px;
        }}
        #MyPrettyCMSMenu {{
            width:{4}px;
            height:{5}px;
        }}
        #MyPrettyCMSContent {{
            width:{6}px;
            height:{7}px;
        }}
        #MyPrettyCMSFooter {{
            width:{8}px;
            height:{9}px;
        }}
        #MyPrettyCMSContent {{
            padding-top:{10}px;
            padding-right:{11}px;
            padding-bottom:{12}px;
            padding-left:{13}px;
        }}
"
, sp_Layout_MainContainerWidth
, sp_Layout_MainContainerHeight
, sp_Layout_PageHeaderWidth
, sp_Layout_PageHeaderHeight
, sp_Layout_MainMenuWidth
, sp_Layout_MainMenuHeight
, sp_Layout_PageContentWidth - (int.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingLeft]) + int.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingRight]))
, sp_Layout_PageContentHeight - (int.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingTop]) + int.Parse(InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingBottom]))
, sp_Layout_PageFooterWidth
, sp_Layout_PageFooterHeight
, InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingTop]
, InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingRight]
, InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingBottom]
, InnovaApp.Portals.MVC4Portal.Controllers.PortalEnvironment.DynamicSettings[enDynamicSettings.MenuLeft_ContentBodyPaddingLeft]
);

    //Admin attributes
    string resizableBlocAdminAttributes_PageHeader = (!layoutModel._AdminMode ? "" : "class=\"resizableBlockContainer BGUpload\" data-resize_axis=\"xy\" data-x_impact=\"$.fn.AdminSettingsLayoutResize('x','#MyPrettyCMSHeader')\" data-y_impact=\"$.fn.AdminSettingsLayoutResize('y','#MyPrettyCMSHeader')\"");
    string resizableBlocAdminAttributes_MainMenu = (!layoutModel._AdminMode ? "" : "class=\"resizableBlockContainer BGUpload\" data-resize_axis=\"xy\" data-x_impact=\"$.fn.AdminSettingsLayoutResize('x','#MyPrettyCMSMenu')\" data-y_impact=\"$.fn.AdminSettingsLayoutResize('y','#MyPrettyCMSMenu')\"");
    string resizableBlocAdminAttributes_MyPrettyCMSContent = (!layoutModel._AdminMode ? "" : " class=\"resizableBlockContainer BGUpload\" data-resize_axis=\"xy\" data-x_impact=\"$.fn.AdminSettingsLayoutResize('x','#MyPrettyCMSContent')\" data-y_impact=\"$.fn.AdminSettingsLayoutResize('y','#MyPrettyCMSContent')\"");
    string resizableBlocAdminAttributes_PageFooter = (!layoutModel._AdminMode ? "" : "class=\"resizableBlockContainer BGUpload\" data-resize_axis=\"xy\" data-x_impact=\"$.fn.AdminSettingsLayoutResize('x','#MyPrettyCMSFooter')\" data-y_impact=\"$.fn.AdminSettingsLayoutResize('y','#MyPrettyCMSFooter')\"");
}
@section HeadLocalCSS {
    @if (!translateMode)
    {
        <link href="/Content/ViewsLayout/LayoutSiteMenuLeft.css" rel="stylesheet" type="text/css" />
        <script src="/Scripts/ViewsLayout/LayoutSiteMenuLeft.js"></script>
        <style type="text/css" id="StyleContentWrapper">
        @cssResizableBlocks
    </style>
        if (IsSectionDefined("HeadLocalCSS"))
        {
        @RenderSection("HeadLocalCSS")
        }
        <script type="text/javascript">
            var sp_ContentHeight = @sp_Layout_ContentHeight;
            $.fn.SiteLayoutPrepareMenu = function () {
                var menuMode = "kendoMenu";
                menuMode = "kendoMenu";
                switch (menuMode) {
                    case "kendoMenu":
                        $("#layoutMenu").kendoMenu({
                            open: $.fn.KendoMenuOpenFixup,
                            orientation: "vertical"
                        });
                        break;
                        //case "kendoPanelBar": LJO: ToDo
                        //    $("#layoutMenu").kendoPanelBar({
                        //        expandMode: "single"
                        //    });
                        //    break;
                        //case "kendoTreeView": LJO: ToDo
                        //    $("#layoutMenu").kendoTreeView({
                        //    });
                        //    break;
                }
                $("#layoutMenu").removeClass("notDisplayed");
            }
        </script>
    }
}
<div class="myprettycms wholePage @adminModeCSSClass LayoutSiteMenuLeft BGUpload">
    <div class="myprettycms content-wrapper BGUpload ">
        <div class="float-left">
            <section id="LanguageSelector">
                @Html.Partial("_LanguageSelector", layoutModel._Languages)
            </section>
        </div>
        <div class="float-right">
            <section id="login">
                @Html.Partial("_LoginPartial", layoutModel._Languages.SelectedLanguage)
            </section>
        </div>
        <div class="myprettycms premenucontent content-wrapper BGUpload">
        </div>
    </div>
    <div id="MyPrettyCMSMainContainer" class="BGUpload">
        <div id="MyPrettyCMSHeader" @Html.Raw(resizableBlocAdminAttributes_PageHeader)>
        </div>
        @if (layoutModel._DisplayMenus)
        { 
            <div id="MyPrettyCMSMenu" @Html.Raw(resizableBlocAdminAttributes_MainMenu)>
                <nav>
                    <div id="divMenuBar" class="BGUpload">
                        @Html.Partial("_MenuBar", layoutModel._Menus)
                    </div>
                </nav>
            </div>
        }
        <div id="MyPrettyCMSContent" @Html.Raw(resizableBlocAdminAttributes_MyPrettyCMSContent)>
            @RenderBody()
        </div>
        <div id="MyPrettyCMSFooter" @Html.Raw(resizableBlocAdminAttributes_PageFooter)>
        </div>
    </div>
</div>
@section SiteFooter{
    @if (!translateMode)
    { 
        <footer>
            <div class="FooterCopyright">
                <a href="http://www.innovacall.com">&copy; INNOVACALL 2012</a>
            </div>
            <div class="FooterLogoMyPrettyCMS">
                <a href="http://www.innovacall.com" target="_blank">
                    <img src="/Images/LogoInnovacallMyPrettyCMS.png" alt="Done with Innovacall My Pretty CMS" />
                </a>
            </div>
        </footer>
    }
}
<div class="notDisplayed" id="SingleFileUploadDialogDiv">
    @using (Html.BeginForm("", "SingleFileUpload", FormMethod.Post, new { id = "SingleFileUploadForm", enctype = "multipart/form-data", target = "SingleFileUploadIFrame" }))
    { 
        <input type="file" id="SingleFileUploadFileInput" name="SingleFileUploadFileInput" class="ui-autocomplete-input ui-widget-content ui-corner-all" />    
        <input type="hidden" name="SingleFileUploadImageToUpdateIdHidden" id="SingleFileUploadImageToUpdateIdHidden" />
        <input type="submit" id="SingleFileUploadSubmitButton" />
    }
    <iframe class="notDisplayed" name="SingleFileUploadIFrame"></iframe>
</div>
